%this function finds the name of a file from its full path

%created by Ricardo Mejia-Alvarez. Urbana, IL. 04/08/09


function FileName = filename(path)
if ispc ==1
    slash(1:length(path)) = '\';
else
    slash(1:length(path)) = '/';
end
namelimit = find(path - slash == 0, 1, 'last');
FileName = path(namelimit + 1 : length(path) );

end
